From: Juergen Gross Date: Thu, 28 Jul 2016 07:21:43 +0000 (+0200) Subject: libxl: fix double free when doing xl save X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~676 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=b29f4c1e37c78874048a34700a967973bb31fbf9;p=xen.git libxl: fix double free when doing xl save Commit d2412fd63b14c6c21d0a3d4367afa448425dfb8a ("libxl: move common nic stuff into one source") introduced a double free error in libxl which occurred during "xl save". Correct this error. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 278285a532..760ebcac7e 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -3228,7 +3228,7 @@ static int libxl__device_channel_from_xenstore(libxl__gc *gc, GCSPRINTF("%s/name", libxl_path), (const char **)(&channel->name)); if (rc) goto out; - rc = libxl__xs_read_checked(NOGC, XBT_NULL, + rc = libxl__xs_read_checked(gc, XBT_NULL, GCSPRINTF("%s/connection", libxl_path), &tmp); if (rc) goto out; if (!strcmp(tmp, "pty")) { diff --git a/tools/libxl/libxl_nic.c b/tools/libxl/libxl_nic.c index ff1834fbe3..c34b7bae8b 100644 --- a/tools/libxl/libxl_nic.c +++ b/tools/libxl/libxl_nic.c @@ -321,19 +321,19 @@ static int libxl__device_nic_from_xenstore(libxl__gc *gc, memset(nic->mac, 0, sizeof(nic->mac)); } - rc = libxl__xs_read_checked(gc, XBT_NULL, + rc = libxl__xs_read_checked(NOGC, XBT_NULL, GCSPRINTF("%s/ip", libxl_path), (const char **)(&nic->ip)); if (rc) goto out; - rc = libxl__xs_read_checked(gc, XBT_NULL, + rc = libxl__xs_read_checked(NOGC, XBT_NULL, GCSPRINTF("%s/bridge", libxl_path), (const char **)(&nic->bridge)); if (rc) goto out; - rc = libxl__xs_read_checked(gc, XBT_NULL, + rc = libxl__xs_read_checked(NOGC, XBT_NULL, GCSPRINTF("%s/script", libxl_path), (const char **)(&nic->script)); if (rc) goto out; - rc = libxl__xs_read_checked(gc, XBT_NULL, + rc = libxl__xs_read_checked(NOGC, XBT_NULL, GCSPRINTF("%s/forwarddev", libxl_path), (const char **)(&nic->coloft_forwarddev)); if (rc) goto out;